#include <commands\client\c_accept_texture_tile.h>
#include <app\states\connectionState.h>

REGISTER_COMMAND(CLIENT_ACCEPT_TEXTURE_TILE, c_accept_texture_tile)

c_accept_texture_tile::c_accept_texture_tile() : command(0, NULL) {
}

c_accept_texture_tile::c_accept_texture_tile(unsigned int _type_id, streamingConnection *_connection) : command(_type_id, _connection) {
}

void 
c_accept_texture_tile::decode(stringstream &bytes_stream, int size) {
#ifdef SERVER
  #ifdef DEBUG_INFO
  std::cerr << "SERVER DECODE: c_accept_texture_tile" << std::endl;
  #endif
#endif
}

void 
c_accept_texture_tile::execute() {
#ifdef CLIENT

  #ifdef DEBUG_INFO
  std::cerr << "CLIENT EXECUTE: c_accept_texture_tile" << std::endl;
  #endif
  unsigned int *id = new unsigned int[1];
  unsigned int *total_size = new unsigned int[1];

  total_size[0] = sizeof(unsigned int); // total size itself

  id[0] = getTypeId();
  total_size[0] += sizeof(unsigned int); // id size

  sendBytes(total_size, sizeof(unsigned int));
  sendBytes(id, sizeof(unsigned int));

#endif
}

